package tw.asap.plus.entity;

import android.os.Parcel;
import android.os.Parcelable;

import tw.asap.plus.entity.response.GoodsInfo;
import tw.asap.plus.entity.response.OrderCreate;
import tw.asap.plus.ui.adapter.PinedSectionAdapter;

/**
 * Description:
 * Created:      [15/11/13]
 * Author:       [Yang]
 **/
public class CartBean extends OrderCreate.ItemsEntity implements Parcelable {

    public PinedSectionAdapter.GoodsItem goodsInfo;

    public CartBean(String item_id, String item_nums, PinedSectionAdapter.GoodsItem goodsInfo) {
        this.item_id = item_id;
        this.item_nums = item_nums;
        this.goodsInfo = goodsInfo;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.item_id);
        dest.writeString(this.item_nums);
        dest.writeParcelable(this.goodsInfo, 0);
    }

    public CartBean() {
    }

    protected CartBean(Parcel in) {
        this.item_id = in.readString();
        this.item_nums = in.readString();
        this.goodsInfo = in.readParcelable(GoodsInfo.ItemListEntity.class.getClassLoader());
    }

    public static final Parcelable.Creator<CartBean> CREATOR = new Parcelable.Creator<CartBean>() {
        public CartBean createFromParcel(Parcel source) {
            return new CartBean(source);
        }

        public CartBean[] newArray(int size) {
            return new CartBean[size];
        }
    };
}
